#include "videobox.h"
#include "ui_videobox.h"

videoBox::videoBox(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::videoBox)
{
    ui->setupUi(this);
    ui->delVideoButton->hide();
    ui->imageBox->installEventFilter(this);
    ui->videoTItleBox->installEventFilter(this);
    playPage = new playVedio();
}

bool videoBox::eventFilter(QObject *watched, QEvent *event)
{
    if(ui->imageBox==watched || ui->videoTItleBox == watched)
    {
        if(event->type()==QEvent::MouseButtonPress)
        {
            onPlayBtnClick();
            return true;
        }
    }
    return QObject::eventFilter(watched,event);
}

void videoBox::onPlayBtnClick()
{
    playPage->show();
}

videoBox::~videoBox()
{
    delete ui;
}
